#include "led.h"


void LED_config(void)
{
    // Configure PU.0 as output pins
    LDOKEYPID = 0x9628;                       // Enable access to config registers 
    PUCTL |= PUOPE + PUOUT1;                  // PortU input enable
                                            // PU.0 = low and PU.1 = high
    LDOKEYPID = 0x0;                          // Disbale access to config registers  
    
    LED1_reset();
    LED2_reset();
}

void LED1_set(void)
{
    LDOKEYPID = 0x9628;                     // Enable access to config registers 
    PUCTL |= PUOUT0;             // XOR PU.0/1    
    LDOKEYPID = 0x0;                        // Disbale access to config registers
}

void LED1_reset(void)
{
    LDOKEYPID = 0x9628;                     // Enable access to config registers 
    PUCTL &= ~PUOUT0;             // XOR PU.0/1    
    LDOKEYPID = 0x0;                        // Disbale access to config registers
}

void LED1_toggle(void)
{
    LDOKEYPID = 0x9628;                     // Enable access to config registers 
    PUCTL ^= PUOUT0;             // XOR PU.0/1    
    LDOKEYPID = 0x0;                        // Disbale access to config registers
}

void LED2_set(void)
{
    LDOKEYPID = 0x9628;                     // Enable access to config registers 
    PUCTL |= PUOUT1;             // XOR PU.0/1    
    LDOKEYPID = 0x0;                        // Disbale access to config registers
}

void LED2_reset(void)
{
    LDOKEYPID = 0x9628;                     // Enable access to config registers 
    PUCTL &= ~PUOUT1;             // XOR PU.0/1    
    LDOKEYPID = 0x0;                        // Disbale access to config registers
}

void LED2_toggle(void)
{
    LDOKEYPID = 0x9628;                     // Enable access to config registers 
    PUCTL ^= PUOUT1;             // XOR PU.0/1    
    LDOKEYPID = 0x0;                        // Disbale access to config registers
}